package iohomework;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo02 {
    public static void main(String[] args) throws IOException {

        File file=new File("fos.txt");
        FileOutputStream fos=new FileOutputStream(file,true);
        String line="我喜欢我飞舞的头发，和飘着雨还是眺望的眼眶。";
        byte[] data=line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        System.out.println("添加成功");
        fos.close();

    }
}
